// 开发平台接口
// 开发平台接口

/**
 * @description: 开放平台 联通测试
 * @return {*}
 */
async function verification(data) {
  const baseURL = ENVS[env_type].OPEN_API_BASE_URL
  const url = "/openapi/v1/shop/connect/verification";
  const res = await request(baseURL, url, data, 'post');
  return res
}

/**
 * @description: 开放平台 同步订单
 * @return {*}
 */
async function syncOrders(data) {
  const baseURL = ENVS[env_type].OPEN_API_BASE_URL
  const url = "/openapi/v2/order/sync";
  const res = await request(baseURL, url, data, 'post');
  return res
}

/**
 * @description: 开放平台 同步订单（批量）  一次最多支持50条订单数据 支持订单新增、更新
 * @return {*}
 */
async function syncOrdersBath(data) {
  const baseURL = ENVS[env_type].OPEN_API_BASE_URL
  const url = "/openapi/v2/order/sync-batch";
  const res = await request(baseURL, url, data, 'post');
  return res
}

/**
 * @description: 开放平台 同步商品
 * @return {*}
 */
async function syncGoods(data) {
  const baseURL = ENVS[env_type].OPEN_API_BASE_URL
  const url = "/openapi/v1/product/sync";
  const res = await request(baseURL, url, data, 'post');
  return res
}





//  塔内应用接口
//  塔内应用接口


/**
 * @description: 获取 登陆用户信息 
 * @return {*}
 */
async function getLoginInfo() {
  const url = "/login/info";
  const res = await request(undefined, url, null, 'post', {"APP-TOKEN": globalData.token});
  return res
}


/**
 * @description: 获取 增量 订单列表
 * @return {*}
 */
async function getIncrementOrdersList(data) {
  const url = "/order/list/incr";
  const res = await request(undefined, url, data, 'post', {"APP-TOKEN": globalData.token});
  return res
}

/**
 * @description: 获取 增量 商品列表
 * @return {*}
 */
async function getIncrementGoodsList(data) {
  const url = "/product/list/incr";
  const res = await request(undefined, url, data, 'post', {"APP-TOKEN": globalData.token});
  return res
}

/**
 * @description: 获取 历史 订单列表
 * @return {*}
 */
async function getHisOrdersList(data) {
  const url = "/order/list";
  const res = await request(undefined, url, data, 'post', {"APP-TOKEN": globalData.token});
  return res
}

/**
 * @description: 获取 历史 商品列表
 * @return {*}
 */
async function getHisGoodsList(data) {
  const url = "/product/list";
  const res = await request(undefined, url, data, 'post', {"APP-TOKEN": globalData.token});
  return res
}